package org.useCode.ThreadLoalTool;


import java.util.Map;
import java.util.Objects;



public class TenantIdUtil {

    private static ThreadLocal<Map<String,String>> TenantIdThreadLocal = new InheritableThreadLocal();


    public  static  String get(String key){
        if (Objects.isNull(TenantIdThreadLocal.get())){
           return null;
        }
        return TenantIdThreadLocal.get().get(key);
    }


    public  static void  set(Map<String,String> map){
        TenantIdThreadLocal.set(map);


    }

    public  static void remove(){

        TenantIdThreadLocal.remove();
    }
}
